Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ffb748fc182d
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 944c0837ccc3
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 9, 2017

  1. Copy the full SHA
    9d9ed00 View commit details

Commits on Jul 13, 2017

  1. Merge pull request #4693 from bew/fiber-little-fixes-while-reading

    fiber: visual code fixes
    RX14 authored Jul 13, 2017
    Copy the full SHA
    944c083 View commit details
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/fiber.cr
5 changes: 3 additions & 2 deletions src/fiber.cr
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ class Fiber
@stack_bottom = @stack + STACK_SIZE
fiber_main = ->(f : Fiber) { f.run }

stack_ptr = @stack + STACK_SIZE - sizeof(Void*)
stack_ptr = @stack_bottom - sizeof(Void*)

# Align the stack pointer to 16 bytes
stack_ptr = Pointer(Void*).new(stack_ptr.address & ~0x0f_u64)
@@ -93,7 +93,8 @@ class Fiber
@@stack_pool.pop? || LibC.mmap(nil, Fiber::STACK_SIZE,
LibC::PROT_READ | LibC::PROT_WRITE,
LibC::MAP_PRIVATE | LibC::MAP_ANON,
-1, 0).tap do |pointer|
-1, 0
).tap do |pointer|
raise Errno.new("Cannot allocate new fiber stack") if pointer == LibC::MAP_FAILED
{% if flag?(:linux) %}
LibC.madvise(pointer, Fiber::STACK_SIZE, LibC::MADV_NOHUGEPAGE)