Presenting CBlockAlloc: a WIP personal project

Hello everyone,

Yesterday, I started a project that I find super interesting. I first thought of it because I saw many people who were trying to do things with the stack only because "dynamic allocation is slow". The main point for why they consider it slow and heavy is that a program needs to talk directly to the OS to allocate memory. However I saw some people propose a solution: allocate once a big chunk of memory that you will use for all your "dynamic" allocations, which makes it way faster because you only need to make a syscall once at the start of the program. I've thus decided to create a library that does just that, and can be called through an API that "simulates" the normal function calls such as malloc() or realloc(). I've been working on it since yesterday, and it's been a lot of fun! it's not ready at all yet, but right now it's looking good. Also, I'm looking for some feedback:

How good is my code for now? Would you do some things differently? Also, would YOU use such a library? What would you expect from a library like that?

Thank you very much for your time, my github profile is Koda-be (I can't send the link to the report because not enough stars and too young).

Also, how could I test my code? I don't really know what to do to test it right now, so...

No AI has been used nor will it be used in this project.

Also, I licensed it under MIT but do I need to do something else? I simply chose a license when creating the REPO, and I don't know much about copyright laws...

reddit.com
u/Koda_be — 4 days ago

Presenting my current WIP project: CBlockAlloc!

Hello everyone,

Yesterday, I started a project that I find super interesting. I first thought of it because I saw many people who were trying to do things with the stack only because "dynamic allocation is slow". The main point for why they consider it slow and heavy is that a program needs to talk directly to the OS to allocate memory. However I saw some people propose a solution: allocate once a big chunk of memory that you will use for all your "dynamic" allocations, which makes it way faster because you only need to make a syscall once at the start of the program. I've thus decided to create a library that does just that, and can be called through an API that "simulates" the normal function calls such as malloc() or realloc(). I've been working on it since yesterday, and it's been a lot of fun! it's not ready at all yet, but right now it's looking good. Also, I'm looking for some feedback:

How good is my code for now? Would you do some things differently? Also, would YOU use such a library? What would you expect from a library like that?

Thank you very much for your time, here's the link to the repo: https://github.com/Koda-be/CBlockAlloc

Also, how could I test my code? I don't really know what to do to test it right now, so...

No AI has been used nor will it be used in this project.

Edit: also, I licensed it under MIT but do I need to do something else? I simply chose a license when creating the REPO, and I don't know much about copyright laws...

u/Koda_be — 4 days ago
▲ 0 r/github

How to require PR's to be approved by admins before merging?f

Hello, I have a public repo that I'd like to protect by making main and dev branches protected. How do I make sure that everyone one that wants to push to those branches must make a PR that has to be approved by an admin? For now, I made a rule for the default branch and for dev that requires a PR before merging, with required approvals = 1 and required discussion conclusion for merge. Do I need to do something else? Thank you kindly

reddit.com
u/Koda_be — 4 days ago

How do compilers recreate inheritance in machine code?

Hello, I've been wondering this for a while, how do compilers simulate inheritance in machine code? Note that I don't really know assembly, so if you could explain it with C concepts (from what I understand, C is 'basically' vulgarized assembly) that would be very appreciated

reddit.com
u/Koda_be — 11 days ago

Am I over-levelled? I just got the 4th great souls from the rotten and the next step is drangleic castle and the dlc

The enemies feel rather weak, and the game feels easy, am I over-levelled for where i am in the story?

Also, in DS1 I did the DLC before doing the Duke's Archive and New Londo, and I was really OP in these places, I first tried all the zones and the bosses, so I'm wondering: right now, I have 2 choices: either I go to Drangleic castle, or I do the DLC's starting with the one in the Black Gulch. I wanna do the dlc's in this playthrough but I fear it's gonna be the same as in DS1 and make me even more OP than I already am and spoil the fun of Drangleic castle (and the rest of the game if there is, please don't spoil me). Which one should I start with? No spoilers please I just need your opinion

u/Koda_be — 13 days ago

[REQUEST][Steam] Dark Souls 2 Scholar of the First Sin

Hello,

Some years ago, I bought Dark Souls Remastered. Dark Souls games have always been games I've wanted to try because I heard they were awesome. Indeed, I finished the base game some times ago, reaching the Link the Fire ending. Some months ago, I started the game again, because I missed every optional bosses and the DLC. I also challenged myself: I couldn't use armor or shields.

And so I embarked on my second journey through Lordran, strong of my previously acquired knowledge and experience, and my faithful and probably-too-hastily-acquired ZweiHänder. What first surprised me was my agility. On my first playthrough, I had made the decision to tank the damages with the most defensive armor I could find. This time, not being able to rely on those, I found myself easily dodging enemy attacks because I wasn't weighed down by a 40 kg chunk of metal. I progressed normally, killing the Taurus demon, leaving the red wyvern be because I couldn't do anything to it in my current state, and continuing to the cathedral. There was the first boss I dreaded. On my first playthrough, it took me more than 20 attempts to beat the bell gargoyles. This time, it only took me around 5. After ringing the bell, I went to darkroot garden to kill the moonlight butterfly and continue my way to lower undead bourg and then to the depths. After killing the gaping dragon, I took a break of the game, though I don't remember why. Around a month after, I launched the game again. There, I played what I believe is the worst part of my run:

#BLIGHTTOWN.

Blighttown was hell for me. Between the thin walkways of the upper area and the poisonous swamps of the lower area, it was extremely tedious for me to navigate. However, I puhed through, and after defeating Queelag, I rang the second bell of awakening and went to Sen's Fortress. It wasn't as bad as I remembered, and the fight against the Iron Golem was really easy for me, even though it took me many attempts in my first playthrough. After that, I went to Anor Londo, where I got bullied by the two archers (again), and fought Ornstein and Smough. Although they took me several attempts (more than in my first playthrough for some reason), I still don't see why people make such a big deal about them, I don't think they're that difficult either.

Now comes the second half of the game. After placing the Lordvessel, I immediately took of to the Ash Lake. I missed this area on my first playthrough and absolutely wanted to see it now. And it was beautiful, probably one of my favourite area in the game. After that, I went for the catacombs. I fought pinwheel, and continued through the tombs of the giants to fight Nito. Then, I killed the darkroot bassin hydra and freed Dusk. I then went to the Duke's Archive to get the broken pendant, then I went straight to Oolacile. I found Oolacile very fun, though very hard. I got my ass kicked by Astoria, and then managed to beat him after several attempts. Oolacile township was also an area that I really liked. And then: the Chasm of the Abyss. I really liked it. The humanities, the trapped Sif, still a pup at the time. And then Manus. Manus is probably the boss I struggled the most against, so much so that I took another break (although it was also because my pc died). That takes us to 3 days ago. I relaunched the game again, and did a few attempts on Manus, before deciding to level up somewhere else and come back later. I went to the demon ruins. I beat Ceaseless Discharge, continued my way in, beat the demon firesage, then the centipede, and then, I was at Lost Izalith. I had to put Solaire out of his misery, and then: Bed of Chaos. It's still the worst boss of the game in my opinion. After beating it, I went to sleep. The next day, I went back to Manus. After yet several attempts, I finally killed him. I think that in total it took me 30 attempts to kill him. After that, I fought Kalameet. It was way easier than Manus, or at least less frustrating in my opinion. I had a lot of fun fighting him.

After finishing the DLC, I went back to Darkroot Garden and kill Sif. Then, New Londo and 4 kings. New Londo is also one of my favourite areas, I really like the atmosphere. And then Duke's archive. Now, this was way more frustrating than I remembered. I got gangbanged by multiple enemies several times, and lost more souls than I'd like to say. I don't really like crystal caves either, because I don't like the invisible paths.

After that, I went to the Kiln of the First Flame. God I love that area. The entrance is so majestic. And the music for the battle agaisnt Gwyn, holy hell it's good. This time, I did the dark lord ending.

I really think I should have done the DLC after the 4 Lords. It gave me so many levels that I first tried every boss after it: Sif, 4 kings, Seath, and Gwyndolyn. Only Gwyn I didn't first try somehow. I'm particularly sad about how easy Gwyndolyn was, because in paper he's such a cool boss.

My top 5 preferred areas of the game:

  1. Lost Izalith: I really like this area and it's lore. It's really too bad it's brought down by the fact it was rushed and it's boss is the worst boss in the game.

  2. Ash Lake: the ambiance is just incredible for me. Not a single thing bad about this area except that there's not more of it.

  3. Oolacile township: really fun and challenging area. The ambiance is also very good

  4. Chasm of the Abyss: same as Oolacile township, but the ambiance is for me even better, plus the fact that you fight humanities is really strange in a good way

  5. Kiln of the First Flame: the sheer grandeur of the place sends me chills every time I see it. The ashes everywhere, the knights still protecting the path, wow.

top 5 bosses:

  1. Ornstein and Smough: They're challenging, and sometimes frustrating since they don't always have a very

  2. Gwyn: not really a hard boss, but his lore, the music, and the runback make him a very good final boss in my opinion.

  3. Sif: I couldn't fight her correctly this run because I was overpowered, but she's still a very good boss and has a very good battle music

  4. Manus: very good boss, very challenging, plus the area he is is really good. Bit frustrating at times though

  5. Kalameet: very challenging too, but less frustrating than Manus, and a very good music

Now, I'd like to continue my journey of the Souls Trilogy with Dark Souls 2. I know it's not as good as DS1 and DS3, but it's still apparently a great game. Besides, I think this challenge I did proves that I can take a blow from a game like this.

Thank you very much.

Steam profile: https://steamcommunity.com/profiles/76561199150783414/

u/Koda_be — 26 days ago

I need help deploying my project with an external library using maven and intellij

Hello, I'm trying to deploy my project, but I'm having trouble with the external library.
Here's my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example</groupId>
  <artifactId>ProjetJava</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>ProjetJava</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-api</artifactId>
          <version>2.26.0</version>
      </dependency>
      <!-- Source: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-core</artifactId>
          <version>2.26.0</version>
          <scope>compile</scope>
      </dependency>
  </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <Classpath>${project.build.finalName}.lib/</Classpath>
                            <mainClass>gestionBar.Controller.Controller.Controller</mainClass>
                        </manifest>
                        <manifestentries>
                            <Class-Path>${project.build.finalName}.lib/org.apache.logging.log4j</Class-Path>
                        </manifestentries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

When I try to package it with maven, it tells me this:

>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar (default-jar) on project ProjetJava: Unable to parse configuration of mojo org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar for parameter Classpath: Cannot find 'Classpath' in class org.apache.maven.archiver.ManifestConfiguration -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

I tried reading the article, but it didn't help me. Can someone help me please? Thank you

reddit.com
u/Koda_be — 2 months ago
▲ 1 r/java

What good external file picker library should I get?

Hello, for my school project, we must add an external library, I was thinking of using one for a file picker (I must choose an image file). What safe library do you recommend? Thanks

reddit.com
u/Koda_be — 2 months ago

Question about pacman

Hello, I ran a full system upgrade today, and that made me wonder something. <pacman -S package&gt; and <pacman -Sy package&gt; respectivelly install and update package. But what happens if I don't provide an argument? I assume -S would refresh the databases for the newer versions of packages without upgrading, and -Sy would also upgrade everything, but then what would be the difference with -Syu?

Sorry if it's a stupid question, I tried searching into it à while back but I couldn't find an answer

reddit.com
u/Koda_be — 3 months ago

Use C string literals for embedded systems?

Hello, I'm working on an embedded arduino project for school, and I'm trying to compare 2 strings, but for performance's sake, I'm trying to use C strings instead of std::String, is there a way to use C string literals in C++? Thanks

Edit: my question isn't how to manipulate c strings, I am more proficient in c than in c++, my problem is that I need to tell the compiler that I'm trying to use c string literals and std::string literals

reddit.com
u/Koda_be — 3 months ago

Hello, my rog G513 laptop is starting, but the rog splash screen never appears and it's not booting. The keyboard lights up with the default setting and the power and airplane indicators are lit, but the screen remains black and the fans don't activate. Its not a screen problem, or at least not only, because I've already had screen problems, and the computer still booted the OS correctly. I've tried doing full reboots at least 5 times, but it didn't work, and worse, it didnt empty the battery and the laptop just started right after. I opened it to clean the fans disconnect the battery for 2 minutes, but alas, my problem persists. I've tried letting it charge fully before starting, and letting it run without stopping (in case some invisible process was being executed) for 3 hours now. Recently the fans activated but they deactivated after a few minutes.

Thanks for the help

reddit.com
u/Koda_be — 4 months ago