Search:

Type: Posts; User: rempas

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds; generated 17 minute(s) ago.

  1. Replies
    12
    Views
    2,340

    I see! Then I guess the best strategy is to...

    I see! Then I guess the best strategy is to pre-allocate a big chunk of memory like I said. Profile your program and act as necessary! Thank you for the information!
  2. Replies
    12
    Views
    2,340

    Great example! If I understood correctly, this is...

    Great example! If I understood correctly, this is exactly what I answered to @christop! No reason to have the library doing extra book-keeping as the users (the programmer that uses the library)...
  3. Replies
    12
    Views
    2,340

    You are actually making a fair point! I suppose,...

    You are actually making a fair point! I suppose, the biggest advantage that the library can give you is been able to "expand" the memory. If you get a new location then you need to also copy the old...
  4. Replies
    12
    Views
    2,340

    Thank you! Yes, I'm putting myself into deep...

    Thank you! Yes, I'm putting myself into deep waters but I hope I'll come out in one piece...
  5. Replies
    12
    Views
    2,340

    I see! So it is not as I expected it. Thank you...

    I see! So it is not as I expected it. Thank you my friend!



    Actually, I'm writing my own system library for my new programing language so it is not just an exercise. I will not copy the way...
  6. Replies
    12
    Views
    2,340

    Thank you for the info! I know how "mmap" works...

    Thank you for the info! I know how "mmap" works and it is actually what I'm using for my system allocator. I suppose that it uses "old_ptr + old_length + 1" as the "address" argument of "mmap" rather...
  7. Replies
    12
    Views
    2,340

    How exactly does "realloc" expands memory?

    I have heard that when you call "realloc", it will first try to expand the current memory you have and if it cannot do that, it will allocate a new memory address and return that instead. Ok, that's...
  8. That's awesome! In my example, I didn't linker...

    That's awesome! In my example, I didn't linker with "libc" tho so I wonder if only the alignment makes this huge difference.
  9. You are actually right! Change the linker to...

    You are actually right! Change the linker to "gold", really reduces the size. Not a lot but it does. I also cannot tell about the libraries as my example didn't link any library but this will be a...
  10. Thank you! I will not spend days but I will spend...

    Thank you! I will not spend days but I will spend some hours for sure!
  11. Yeah, sorry! I was talking about the size of the...

    Yeah, sorry! I was talking about the size of the file. I thought it was clear.



    Are the "unnecessary" stuff the sections? If I'm not wrong, the final executable needs only the segments right?...
  12. Ok, first of all. Why you are making the...

    Ok, first of all. Why you are making the conclusion that I'm bothered by the executable size? I cannot make, I just make a question out of interested and interest my friend?

    However, one reason...
  13. Why do compilers produce so much bloated executables?

    Hello! First of all, let me link this: [GitHub - vishen/go-x64-executable: Generate ELF Linux 64-bit (x86-64) executable manually] repo which is a program written in the Go programming language that...
  14. Brendan's idea is BRILLIANT! the compiler can...

    Brendan's idea is BRILLIANT! the compiler can predict the possible ranges of a variable can at compile time and give a warning. Even if the programmer has created 5 tests (which I doubt), there is...
  15. I'm sorry for not making it clear but I will not...

    I'm sorry for not making it clear but I will not write a compiler for C but I'll make a new language. I'm just writing the compiler in C at this point. Of course, make a compiler for a language and...
  16. SUBMISSION: How comparing a signed with an unsigned variable resulted to a sneaky bug

    *********
    As I was typing this and I was about to post this, I was doing `undo` in my editor to go back to the original code (the one I'm posting). However, I missed one `undo` and I run the program...
  17. ........! I didn't thought about that! Then I'm...

    ........! I didn't thought about that! Then I'm back into learning Assembly and Machine language (and ELF of course). Tbh, after I posted this, I found some articles and a great repo on Github that...
  18. Is there a way to ask for a register and GUARANTY that I'll get it?

    I'm interesting in founding a way (if any) to guaranty that I'll ask for a specific register and that I'll get it. I want the compiler to ignore this register and not use it for the rest of the...
  19. Replies
    0
    Views
    786

    Any compiler backend you know?

    I'm searching for compiler backends to use for my compiler. The things I'm looking for are:



    Either be written in C or have official bindings in C (actively maintained by the developers)...
  20. Thanks a lot for the info! It really helps!

    Thanks a lot for the info! It really helps!
  21. This makes it very clear! I also see where I was...

    This makes it very clear! I also see where I was wrong with my implementation! Thanks a lot!
  22. That's what I'm saying! Why put the code in the...

    That's what I'm saying! Why put the code in the "else" branch in the skip and have to jump and not do the opposite and have to jump in the "if" branch like I did in my hand written assembly? Then,...
  23. Thank you! I will read it!

    Thank you! I will read it!
  24. Wait! So If I get this correctly, you are telling...

    Wait! So If I get this correctly, you are telling me that if the most cases, the code inside the "if" block gets executed, it will run faster than if it didn't jumped and kept going (which in this...
  25. Thanks! I've also seen your first reply and it...

    Thanks! I've also seen your first reply and it took me some minutes to analyze it but I got it! Still, I think that not jumping is faster even when we jump without the branching penalty.

    Well, I...
Results 1 to 25 of 108
Page 1 of 5 1 2 3 4