problem about internals-Collection of common programming errors


  • Adam Lewis
    java internals jvm-hotspot
    What are the limitations when modifying classes in rt.jar. I realize this is generally specific to the version and vendor of the JRE. I’ve found that Hotspot in the Sun 1.6 VM, for instance, doesn’t like if you add fields to java.lang.Object as it has hard-coded assumptions about the size of Object. However, if I modify significant portions of the classes in rt.jar, I get spurious ClassNotFoundErrors at runtime for classes that are definitely in my jar. I’ve tried modifying rt.jar in place a

  • Amitd
    c# interface clr internals
    Just curious about how .NET CLR handles interfaces internally?Q1] What happens when CLR encounters something like :simple interface example. (same used below.)interface ISampleInterface{void SampleMethod();}class ImplementationClass : ISampleInterface{// Explicit interface member implementation: public void SampleMethod(){// Method implementation.}static void Main(){//Declare an interface instance.ISampleInterface mySampleIntobj = new ImplementationClass(); // (A)// Call the member.mySampleInt

  • Edwin Dalorzo
    java optimization jvm internals jdk8
    A working document describing the state of Project Lambda mentions the so-called SAM (single abstract method) types. As far as I know the current lambda proposal doesn’t affect the runtime just the compiler by making possible automatic conversion from lambda expressions to these types.I think in ideal circumstances instances of SAM types could be internally represented by function pointers. Therefore the JVM could avoid memory allocation for these instances.I am wondering whether the modern virt

  • Alex Rønne Petersen
    c# .net runtime internals value-type
    I’m wondering if there are any technical reasons for why .NET value types do not support inheritance (disregarding interface implementation)… I can’t at first glance think of a reason why value types shouldn’t allow single base class inheritance.(I mean, arguably, inheritance for value types would be bad if you end up with a huge inheritance hierarchy, but I’m mostly wondering if there are any runtime limitations rather than practical limitations.)Thanks.

  • leppie
    .net clr cil internals
    Is it done at compile time? Because the index into the MethodTable of the method to call could be determined at compile time.Or ist it done at runtime?And what is the method token argument to callvirt?

  • dante
    windows visual-c++ memory-management heap internals
    I am trying to make my application to use lookaside lists for memory management. I know the following details from various papers on this subject.Lookaside lists are located at offset +0x688 from the heap base Each member is 48 bytes long. lookasidelist[0],lookasidelist[1] not used. lookasidelist[n] block is of size n*8 and used to store (n-1)*8 byte blocks (remaining 8 bytes is used for header) and offset 0 points to a linked list containing free chunks of size (n-1)*8 terminating with null. Lo

  • Sinix
    clr internals
    Please, can anyone provide more detail on the figure from the “How the CLR Creates Runtime Objects” article?I’m confused with “string literals” section, I’m not able to find any reason to store those as the part of every object instance and I even could not deduct what is really stored there:#US (user string) stream record id? No, those emitted directly into IL as a ldstr param and are hardcoded into the JITted code at runtime. There’s no need to store it as a part of each instance.Runtime-inter

  • svick
    .net dllimport internals
    Many methods in the .Net library are implemented in native code. Those that come from the framework itself are marked with [MethodImpl(MethodImplOptions.InternalCall)]. Those that come from some unmanaged DLL are marked with [DllImport] (e.g. [DllImport(“kernel32.dll”)]). So far nothing unusual.But while writing answer for another question, I discovered there are many methods marked with [DllImport(“QCall”)]. They seem to be internal implementation of .Net (e.g. GC._Collect()).My question is: Wh

  • Kartick Vaddadi
    objective-c categories internals
    I know how to use categories as a programmer, but I’m curious how they are implemented. Does the compiler compile them into calls to class_replaceMethod from a static initializer? Thanks.

  • rockstartprogrammer
    windows sockets linux-kernel operating-system internals
    I have two questions, both are them may be related so I am asking at once. Linux has /proc directory which is runtime data structure and gives information about running process. Does windows have any such directory where I can get runtime info about process, like its layout and open handles. Please do no suggest tools like Process Explorer, its good but they are not part of core windows os.Secondly, it is said for Windows that not everything is file, like socket is not a file. Does it mean that

  • eddi
    c r internals
    I re-read the bit about garbage collection in writing R extensions multiple times now, and still don’t understand the difference between these two usages:SEXP var = PROTECT(allocVector(STRSXP, 100));vsSEXP var; PROTECT(var = allocVector(STRSXP, 100));So far I’ve had worse luck with the first one as my session sometimes crashes with it (yet I see that usage a lot in both real code and in the intro guide itself). Can someone please explain the difference between these two assignments?edit:After so

  • eugeniodepalo
    ruby class methods internals metaclass
    I was studying how the Ruby interpreter is implemented, and one question occurred that didn’t get an answer yet for me. That’s the one in the title: since Class (r_cClass) has super set to itself (ignoring metaclasses, since actually super is the metaclass of r_cClass), if I send one method to the Class object, this will be looked in the method table of Class’ class. But Class’ class is Class, so shouldn’t I end up looking the instance methods of Class? But that’s not the case since in the docum

  • YMMD
    javascript jquery this internals
    I know how to use jQuery’s $(this) selector and I also understand the principles of OOP in Javascript. I always accepted that it just works, because somebody else implemented it, but I would love to know why and how it works.$(function(){$(‘.foo’).each(function(){console.log($(this));}); });Given this code. I know that $(‘.foo’) finds a set of HTML elements and returns a jQuery object which is able to iterate over them using .each(…). The internal structure of the each() method then probably c

  • Virtlink
    c# compiler internals
    Been browsing through .NET source code of .NET Framework Reference Source, just for fun of it. And found something I don’t understand. There is a Int32.cs file with C# code for Int32 type. And somehow that seems strange to me. How does the C# compiler compile code for Int32 type? public struct Int32: IComparable, IFormattable, IConvertible {internal int m_value;// … }But isn’t this illegal in C#? If int is only an alias for Int32, it should fail to compile with Error CS0523: Struct member ‘st

  • iammilind
    c++ c operating-system segmentation-fault internals
    struct A { int i; }; … A *p = (A*) (8); // or A *p = 0; p->i = 5; // Undefined Behavior according C/C++ standardHowever, practically most of the system would crash (segmentation fault) for such code.Does it mean that all such Architectures/Systems have a hidden check for pointer indirection (i.e. p->) to verify if it’s accessing a wrong memory location ?If yes, then it implies that even in perfectly working code we are paying the price for that extra check, correct ?

Web site is in building