You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-8
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,18 @@
1
1
2
+
2
3
# Libft
3
-
My own libC to use at 42.
4
-
Most of the functions are defined in libft.h (and even if they're defined somewhere else you will find a comment in libft.h)
4
+
My own libC to use at 42.
5
+
Most of the functions are defined in `libft.h`, appart from the t_vec4 related ones (because they are all inline).
6
+
`intrisics.h` contains the structures t_lst, t_vector, t_vec4, t_queue, (...) and all the defines.
7
+
## Some stats
8
+
- 128 files for ~4000 lines of code (not counting the headers).
9
+
- Some functions as fast or faster than the libC (depending on your system) without the use of any ASM.
5
10
## What's inside
6
-
My libft contains lots of functions and datatypes with their own 'operators', all of them are described in libft.h and again by the folder names in ./src
11
+
My libft contains lots of functions and datatypes with their own 'operators', most of them are described in `libft.h`. The folder names in `./src` are also quite descriptive.
7
12
### At the time of writing, this libft contains :
8
13
#### libmem
9
-
- ft_bzero (uses AVX/SSE !)
10
-
- ft_mem(...) Functions in here are generaly optimized to use the biggest registers available and use as few cpu cycles as possible (yay AVX)
14
+
- ft_bzero
15
+
- ft_mem(...)
11
16
#### libstr
12
17
- ft_str(...)
13
18
#### libnb
@@ -25,6 +30,7 @@ My libft contains lots of functions and datatypes with their own 'operators', al
25
30
- ft_vprintf
26
31
- (...)
27
32
supports pUudioxXsfcbr ('b' prints an int in binary, 'r' reads a file descriptor)
33
+
28
34
#### t_lst
29
35
Operators for the t_lst datatype. t_lst being defined as :
30
36
```c
@@ -36,9 +42,8 @@ typedef struct s_list
36
42
} t_list;
37
43
38
44
```
39
-
45
+
40
46
#### t_queue
41
-
42
47
Operators for the t_queue datatype. t_queue being defined as :
43
48
```c
44
49
typedefstruct s_queue
@@ -50,6 +55,7 @@ typedef struct s_queue
50
55
} t_queue;
51
56
```
52
57
t_queue is a 'rotary' queue based on an array, it's *really* fast
58
+
53
59
#### t_vec4
54
60
Operators for an implementation of vectors of 4 floats (x, y, z, w) using SSE (__m128) :
55
61
```c
@@ -66,5 +72,9 @@ typedef union u_vec4
66
72
} t_vec4;
67
73
```
68
74
All the operators in there are inline and included by 'libft.gen' at compile time (I have to resort to this type of trickery because of 42s restrictive norme).
75
+
#### t_garbage
76
+
A simple (but still 12 files and ~200 LOC) garbage collector for C.
77
+
It's utterly stupid but basically needed because of some bad people at 42.
78
+
69
79
#### other stuff
70
-
There's like... msg_exit ("a printf for crashing cleanly")
80
+
There's like... msg_exit ("a printf for crashing cleanly")
0 commit comments