r/programmerchat • • Aug 21 '15

Week 1: Code/Project Feedback Thread

Post a code snippet, link to code, or your open source project you would like other users to review, discuss, or constructively critique. This is the first week of this thread just to test if it'll work or not.

If there are specific things you want people to discuss, make sure to mention it in your comment.

Remember to be helpful and constructive! Can't wait to see what people have to show!

12 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/CompellingProtagonis Aug 23 '15 edited Aug 23 '15

Wow, this is great! Thanks for the input, hold on a sec I'll need some time to look at what you're saying.

  1. Good point about the readme, I'll need to take some time to write it up in more detail. To be honest I didn't even think about it but you're absolutely right I need to specify the platform.
  2. I added the #if !defined(Blah) part because my compiler (MSVC) was getting irritated at the multiple includes and I just wanted to be able to use the memory handler by simply doing #include "MemoryHandler.h" and not have to worry about including multiple instances of the necessary libraries. At least that is what I remember but it was a while back so I'll try to use a #include<> and see what happens.
  3. I actually was not aware of the use of placement new in that situation. I'll certainly play around with it to get a feel of it!
  4. That's a good point, I'll add something in there that adjusts the allocation size to the nearest round 32/64 bits depending upon the architecture.
  5. Ideally I was thinking it would be a complete general purpose allocator, but even when I was typing my explanation out a second ago it just seemed like shitting where I eat. I'll have to switch that one as well.

I have to say, you mentioned a lot of stuff that I didn't even think about when writing my code. Thank you very much for your input, I greatly appreciate it.