Skip to content

Commit

Permalink
kernel: preallocate 4 slots for process' fd array
Browse files Browse the repository at this point in the history
  • Loading branch information
ffwff committed Oct 18, 2019
1 parent 830a9fb commit 889e1f8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/multiprocessing/process.cr
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ module Multiprocessing
property pgid

This comment has been minimized.

Copy link
@asterite

asterite Oct 18, 2019

Did you know you can do:

property pgid = 0u64

and it's equivalent to the two lines above?

This comment has been minimized.

Copy link
@ffwff

ffwff Oct 19, 2019

Author Owner

In vanilla Crystal you can but my implementation of the property macro can't.

Maybe you could do a pull request to fix that idk

This comment has been minimized.

Copy link
@asterite

asterite Oct 19, 2019

Ooooh... You are right! I forgot you have a separate prelude and std.


# files
MAX_FD = 16
property fds

# mmap
Expand Down Expand Up @@ -148,7 +147,7 @@ module Multiprocessing
def initialize(@argv : GcArray(GcString),
@cwd : GcString, @cwd_node : VFSNode,
@environ = GcArray(EnvVar).new(0))
@fds = GcArray(FileDescriptor?).new MAX_FD
@fds = GcArray(FileDescriptor?).new 4
@mmap_list = MemMapList.new
end

Expand Down

0 comments on commit 889e1f8

Please sign in to comment.